<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="bean.entity.*,bean.dal.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<jsp:include page="top.jsp"></jsp:include>
	<script type="text/javascript" >
		function check(){
			var adminid=document.getElementById('adminid').value;
			var password=document.getElementById('password').value;
			var adminname=document.getElementById('adminname').value;
			if(adminname==""||adminname==null){
				window.alert("姓名不能为空！");
				document.update.adminname.focus();
				return false;
			}
			if(password==""||password==null){
				window.alert("密码不能为空！");
				document.update.password.focus();
				return false;
			}
			if(adminid==""||adminid==null){
				window.alert("账号不能为空！");
				document.update.adminid.focus();
				return false;
			}
			return true;
		}
	</script>


	<%
		String msg = (String) session.getAttribute("msg");
		session.setAttribute("msg","");
		String adminid= (String) session.getAttribute("adminid");
		if(adminid==null) adminid="";
		Admin admin= new Admin();
		AdminManager adminM=new AdminManager();
		admin=adminM.getAdminByAdminId(adminid);
	%>
    <form id="bigBox" method="POST" action="/express/servlet/AdminLogin?role=admin&modth=update&id=<%=admin.getId() %>" name="update" onsubmit="return check()">
        <h1>管理员个人信息</h1>
        <font color="red">
            <span id="message">
                <%if(msg==null){msg="";} %>
                    <%=msg %>
            </span>
        </font>
        <!-- 添加管理员信息界面容器 -->
        <div class="inputBox">
            <!-- 管理员账号 -->
            <div class="inputText">
                <span>
                    <i class="iconfont icon-phone"></i>
                    账号:
                </span>
                <input type="text" id="adminid" name="adminid" placeholder="Adminphone" value="<%=admin.getAdminid() %>">
            </div>
            <!-- 管理员姓名 -->
            <div class="inputText">
                <span>
                    <i class="iconfont icon-user"></i>
                    姓名:
                </span>
                <input type="text" id="adminname" name="adminname" placeholder="Adminname" value="<%=admin.getAdminname() %>">
            </div>
            <!-- 密码 -->
            <div class="inputText">
                <span>
                    <i class="iconfont icon-password"></i>
                    密码:
                </span>
                <input type="text" id="password" name="password" placeholder="Password">
            </div>
            <!-- 修改按钮 -->
            <input type="submit" class="inputButton" value="修改">
            <!-- 返回按钮 -->
            <a href="admin/index.jsp">
                <input type="button" class="inputButton" value="返回">
            </a>
        </div>
    </form>
  </body>
</html>
